﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Security;

namespace Props.AdminWeb.Controllers
{
    public class BaseController : Controller
    {
        public string VendorName
        {
            get
            {
                if (Request.IsAuthenticated)
                {
                    var vendorName = HttpContext.User.Identity.Name;
                    if (vendorName == null)
                    {
                        FormsAuthentication.SignOut();
                        return string.Empty;
                    }

                    return vendorName.ToString();
                }
                else
                    return String.Empty;
            }
        }

        protected override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            base.OnActionExecuting(filterContext);
        }

        protected override void OnAuthorization(AuthorizationContext filterContext)
        {
            base.OnAuthorization(filterContext);
        }

    }
}
